package emp.jsf.servicio.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired; 
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; 
import org.springframework.transaction.annotation.Transactional;

import emp.jsf.servicio.FormaPagoService;
import emp.repositorios.FormaPagoRepository;
import emp.entidades.EntFormaPago;

@Service("FormaPagoService")
public class FormaPagoServiceImpl implements FormaPagoService  {
	
	@Autowired
	FormaPagoRepository formaPagoRepository;
	
	public List<EntFormaPago> buscarFormaPago(){
		return formaPagoRepository.findAll();
	}
	
	public EntFormaPago grabarFormaPago(EntFormaPago ent){ 
		return formaPagoRepository.save(ent);
	}
	
	public void eliminar(String id){ 
		EntFormaPago ent=formaPagoRepository.findOne(Long.valueOf(id));
		formaPagoRepository.delete(ent);
	}
	
}

